// Showcase.ts

import { Group, Vector3 } from 'three';
import InstancedMeshBase from 'three-base/InstancedMeshBase';
import showcaseGLB from './showcase.glb?url';

// 展台
export default class Showcase extends Group {
  constructor() {
    super();
  }

  mesh = (() => {
    const mesh = new InstancedMeshBase(showcaseGLB);
    mesh.setCount(400);
    for (let x = 0; x < 20; x++) {
      for (let z = 0; z < 20; z++) {
        mesh.setTRS(x * 20 + z, {
          position: new Vector3(x * 100 + 100, 0, z * -100),
          scale: new Vector3(100, 100, 100),
        });
      }
    }
    this.add(mesh);
    return mesh;
  })();
}
